package com.blockchain.front.service.trading;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.blockchain.common.enums.IsPass;
import com.blockchain.framework.service.Service;
import com.blockchain.framework.service.query.Paging;
import com.blockchain.framework.service.query.PagingResult;
import com.blockchain.front.service.financial.entity.JlEntity;
import com.blockchain.front.service.financial.entity.UserZhEntity;
import com.blockchain.front.service.financial.entity.WdwtEntity;
import com.blockchain.front.service.security.entity.QbdzEntity;
import com.blockchain.front.service.trading.entity.HqEntity;
import com.blockchain.front.service.trading.entity.PjEntity;
import com.blockchain.front.service.trading.entity.WtEntity;
import com.blockchain.front.service.trading.entity.XlbEntity;
import com.blockchain.front.service.trading.entity.XxcsEntity;
import com.blockchain.front.service.trading.entity.ZhEntity;

/**
 * 交易中心
 * 
 */
public abstract interface TradingManage extends Service {

	/**
	 * 描述：查询虚拟币信息（有分区）
	 */
	public abstract QbdzEntity[] getXlb() throws Throwable;

	/**
	 * 描述：查询用户账户信息（虚拟币）
	 * 
	 */
	public abstract UserZhEntity getZhXlb(int scid) throws Throwable;

	/**
	 * 描述：查询币ID
	 * 
	 */
	public abstract int getBid(int scid) throws Throwable;

	/**
	 * 描述：查询委托记录
	 * 
	 */
	public abstract JlEntity[] searchWtjl(int scid) throws Throwable;

	public abstract WdwtEntity[] searchWdwt(int scid) throws Throwable;

	/**
	 * 描述：查询虚拟币信息
	 * 
	 */
	public abstract XlbEntity[] getXlbList(int scid) throws Throwable;

	/**
	 * 描述：查询虚拟币信息
	 * 
	 */
	public abstract XlbEntity getB(int scid) throws Throwable;

	/**
	 * 描述：买入
	 * 
	 */
	public abstract int tradingMr(int scid, BigDecimal price, BigDecimal num, String... parameter) throws Throwable;

	/**
	 * 描述：卖出
	 * 
	 */
	public abstract int tradingMc(int scid, BigDecimal price, BigDecimal num, String... parameter) throws Throwable;

	/**
	 * 描述：查询行情详细信息
	 * 
	 */
	public abstract HqEntity getHq(int scid) throws Throwable;

	/**
	 * 描述：查询委托买单
	 * 
	 */
	public abstract WtEntity[] getWtMr(int scid) throws Throwable;

	/**
	 * 描述：查询委托卖单
	 * 
	 */
	public abstract WtEntity[] getWtMc(int scid) throws Throwable;

	/**
	 * 描述：查询成交记录 i=0;首次 i=1;3秒一次
	 * 
	 */
	public abstract WtEntity[] getCjjl(int scid, int i) throws Throwable;

	/**
	 * 描述：查询用户密码输入设置
	 * 
	 */
	public abstract String getMmsr() throws Throwable;

	/**
	 * 描述：首页行情信息
	 * 
	 */
	public abstract HqEntity[] hqList() throws Throwable;

	/**
	 * 查询K线历史内容
	 * 
	 * @return
	 * @throws Throwable
	 */
	public abstract String getKline(long market, long time) throws Throwable;

	/**
	 * 获取最新成交数据
	 * 
	 * @param market
	 * @param since
	 * @return
	 * @throws Throwable
	 */
	public abstract String getKlineNew(long market, long since) throws Throwable;

	/**
	 * 校验交易密码
	 * 
	 * @param market
	 * @param since
	 * @return
	 * @throws Throwable
	 */
	public boolean Jymm(String... jymm) throws Throwable;

	/**
	 * 常用链接列表
	 * 
	 * @param market
	 * @param since
	 * @return
	 * @throws Throwable
	 */
	public abstract XxcsEntity[] cyljSearch(int scid) throws Throwable;

	/**
	 * 机器人API接口</br>
	 * 获取所有币种行情</br>
	 * 修改时间：2017-7-27 09:23:18</br>
	 * 
	 * @param name
	 *            币种名称/t卖方币种_买方币种
	 * @return
	 * @throws Throwable
	 */
	public abstract Map<String, Object> getAllCoin(String name) throws Throwable;

	/**
	 * 获取所有市场信息</br>
	 * 修改时间：2017-7-27 09:23:18</br>
	 * 
	 * @param name
	 *            币种名称/t卖方币种_买方币种
	 * @return
	 * @throws Throwable
	 */
	public abstract List<Map<String, Object>> getMarket(String name) throws Throwable;

	/**
	 * 获取单个币种深度</br>
	 * 修改时间：2017-7-27 09:23:18</br>
	 * 
	 * @param name
	 *            币种名称/t卖方币种_买方币种
	 * @param name
	 * @return
	 * @throws Throwable
	 */
	public abstract Map<String, Object> getDepth(String name) throws Throwable;

	/**
	 * 获取单个币种交易记录</br>
	 * 修改时间：2017-7-27 09:23:18</br>
	 * 
	 * @param name
	 *            币种名称/t卖方币种_买方币种
	 * @param name
	 * @return
	 * @throws Throwable
	 */
	public abstract Map<String, Object> getTrades(String name) throws Throwable;

	/**
	 * 获取用户虚拟币余额</br>
	 * 修改时间：2017-7-27 09:23:18</br>
	 * 
	 * @param apikey&nbsp;&nbsp;用户公钥
	 * 
	 * @return
	 * @throws Throwable
	 */
	public abstract Map<String, Object> getUserCoin(String apikey) throws Throwable;

	/**
	 * 获取用户ID</br>
	 * 修改时间:2017年7月27日15:45:47
	 *
	 * @param apikey&nbsp;&nbsp;用户公钥
	 * @return
	 * @throws Throwable
	 */
	public abstract Integer getUserId(String apikey) throws Throwable;

	/**
	 * 获取用户人民币余额</br>
	 * 修改时间：2017-7-27 09:23:18</br>
	 * 
	 * @param apikey&nbsp;&nbsp;用户公钥
	 * @return
	 * @throws Throwable
	 */
	public abstract Map<String, Object> getUserCny(String apikey) throws Throwable;

	/**
	 * 查询交易中的订单</br>
	 * 修改时间：2017-7-27 09:23:18</br>
	 * 
	 * @param name
	 *            币种名称/t卖方币种_买方币种
	 * @param apikey&nbsp;&nbsp;用户公钥
	 * @return
	 * @throws Throwable
	 */
	public abstract List<Map<String, Object>> queryOrder(String name, String apikey) throws Throwable;

	/**
	 * 获取用户单个币种交易记录</br>
	 * 修改时间：2017-7-27 09:23:18</br>
	 * 
	 * @param name
	 *            币种名称/t卖方币种_买方币种
	 * @param apikey&nbsp;&nbsp;用户公钥
	 * @return
	 * @throws Throwable
	 */
	public abstract Map<String, Object> getMyTradeLog(String name, String apikey) throws Throwable;

	/**
	 * 详细信息
	 * 
	 * @param market
	 * @param since
	 * @return
	 * @throws Throwable
	 */
	public abstract XxcsEntity[] xxcsSearch(int scid, IsPass is) throws Throwable;

	/**
	 * 添加评价
	 * 
	 * @param market
	 * @param since
	 * @return
	 * @throws Throwable
	 */
	public abstract void addPj(int scid, String nr, int js, int yy, int qj) throws Throwable;

	/**
	 * 评价列表
	 * 
	 * @param market
	 * @param since
	 * @return
	 * @throws Throwable
	 */

	public abstract PagingResult<PjEntity> searchPj(int scid, Paging paging) throws Throwable;

	/**
	 * 评分
	 * 
	 * @param market
	 * @param since
	 * @return
	 * @throws Throwable
	 */
	public abstract PjEntity pf(int scid) throws Throwable;

	/**
	 * 点赞
	 * 
	 * @param market
	 * @param since
	 * @return
	 * @throws Throwable
	 */
	public abstract void dz(int pjid, int type) throws Throwable;

	/**
	 * 重复点赞
	 * 
	 * @param market
	 * @param since
	 * @return
	 * @throws Throwable
	 */
	public abstract int conut(int pjid) throws Throwable;

	/**
	 * 描述：用户账户信息（）
	 * 
	 */
	public abstract ZhEntity getZh(int scid) throws Throwable;

	/**
	 * 普通kLine Json 接口
	 * @param marketId
	 * @return
	 */
	public abstract String getOrdinaryList(long market, long time) throws Throwable;

	/**
	 * @param id 用户id
	 * @return 获取用户账户情况 coinShortName币种，available可用，frozen冻结）
	 * @throws Throwable
	 */
	public abstract List<HashMap<String, Object>> getUserAccount(int id) throws Throwable;
	/**
	 * 获取指定市场N天内的的折线数据 
	 * 数据格式如：[3.1,2,1.0,...]
	 * */
	public abstract String getBrokenLine(int marketId,int days) throws Throwable;
}
